import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 分页列表
export function list (query) {
    return request({
        url: '/school/teacher/schoolPage',
        method: 'get',
        params: query
    })
}

// 详情
export function getById (query) {
    return request({
        url: '/school/teacher/getById/' + query.id,
        method: 'get',
        params: query
    })
}

// 新增
export function add (data) {
    return request({
        url: '/school/teacher/add',
        method: 'post',
        data: data
    })
}

// 修改
export function edit (data) {
    return request({
        url: '/school/teacher/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/school/teacher/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 重置密码
export function resetPwd (params) {
    return request({
        url: '/school/teacher/resetPwd',
        method: 'put',
        params
    })
}

// 冻结/解冻
export function setStatus (data) {
    return request({
        url: '/school/teacher/setStatus/' + data.id,
        method: 'put',
        data
    })
}

// 批量解冻
export function setStatusByIds (data) {
    return request({
        url: '/school/teacher/setStatusByIds/' + data.id,
        method: 'put',
        data
    })
}

// 导出老师
export function getExport () {
    return request({
        url: '/school/teacher/export',
        method: 'post'
    })
}

// 导出老师模版
export function importTemplate () {
    return request({
        url: '/school/teacher/importTemplate',
        method: 'post'
    })
}

// 老师列表
export function getList (query) {
    return request({
        url: '/school/teacher/getList',
        method: 'get',
        params: query
    })
}